import { createApp } from 'vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import Vant from 'vant'
import 'vant/lib/index.css'

function registerPlugin(nuxtApp, plugin) {
  const app = createApp({})
  app.use(plugin)
  nuxtApp.vueApp.use(plugin)
}

export default defineNuxtPlugin((nuxtApp) => {
  registerPlugin(nuxtApp, ElementPlus)
  registerPlugin(nuxtApp, Vant)
})